<template>
  <el-select
    v-model="value"
    class="m-2"
    placeholder="Select"
    size="large"
    @change="(value)=>emits('change',value)"
  >
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value"
    />
  </el-select>
</template>
<script setup>
import { computed } from 'vue';
const emits =defineEmits(['update:modelValue','change'])

const props = defineProps({
    modelValue:{
        type:[Array,String],
        default:()=>[]||''
    },
    options:{
        type:Array,
        default:()=>[]
    }
})

const value = computed({
    set(value){
        emits('update:modelValue',value)
    },
    get(){
        return props.modelValue
    }
})
</script>